﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace FrmMain
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

        }

        private void btnBreak_Click(object sender, EventArgs e)
        {
            Application.Exit();
        }
        ServiceZ service = new ServiceZ();
        private void btnOK_Click(object sender, EventArgs e)
        {
            if (this.txtName.Text != null || this.txtPwd.Text != null)
            {
                string LoginName = this.txtName.Text;
                string LoginPwd = this.txtPwd.Text;
                  int result =   service.doLogin(LoginName, LoginPwd);
                if (result > 0)
                {
                    MessageBox.Show("登录成功");
                    Form2 frm = new Form2();
                    frm.Show();

                }
                else {
                    MessageBox.Show("密码或用户名错误");
                }
            }
            else {
                MessageBox.Show("请输入账号密码");

            }
           
        }
    }
}
